//
//  RenwuViewController.m
//  penzer
//
//  Created by caiyc on 2018/10/18.
//  Copyright © 2018年 caiyc. All rights reserved.
//

#import "RenwuViewController.h"
#import "RenwuCell.h"
@interface RenwuViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UILabel *lab2;
@property (weak, nonatomic) IBOutlet UIButton *btn1;
@property (weak, nonatomic) IBOutlet UILabel *lab1;
@property (weak, nonatomic) IBOutlet UIButton *btn2;
@property (weak, nonatomic) IBOutlet UITableView *tableView;

@end

@implementation RenwuViewController

- (void)viewDidLoad {
    [super viewDidLoad];
     [self setNavigation:1 andTitle:@"任务中心" andNaviColor:[UIColor whiteColor] andTitleColor:nil];
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    self.tableView.tableFooterView = [[UIView alloc]initWithFrame:CGRectZero];
    [self setViews];
    // Do any additional setup after loading the view from its nib.
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 2;
    
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString *CellId = @"cell";
    RenwuCell *cell = [tableView dequeueReusableCellWithIdentifier:CellId];
    if(!cell){
        cell = [[[NSBundle mainBundle]loadNibNamed:@"RenwuCell" owner:self options:nil]lastObject];
    }
    return cell;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 70;
}
-(void)setViews{
    self.lab2.hidden = 1;
   // self.btn1.selected = 1;
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (IBAction)selectAction:(UIButton *)sender {
   // sender.selected = !sender.selected;
    if(sender.tag==0){
        self.lab2.hidden = 1;
        self.lab1.hidden = 0;
         [self.btn1 setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
         [self.btn2 setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
    }else{
        self.lab2.hidden = 0;
        self.lab1.hidden = 1;
        
        [self.btn2 setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        [self.btn1 setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
    }
}
@end
